﻿using Shop.RemoteModel.SpecGroupTemplate;
using Shop.RemoteModel.SpecGroupTemplate.Model;
using Shop.Service.Interface;
using WeDonekRpc.Client.Interface;

namespace Shop.Service.RpcEvent
{
    internal class SpecGroupTemplateEvent : IRpcApiService
    {
        private readonly ISpecGroupTemplateService _Service;

        public SpecGroupTemplateEvent (ISpecGroupTemplateService service)
        {
            this._Service = service;
        }
        public Dictionary<long, int> SetSpecGroupTSort (SetSpecGroupTSort obj)
        {
            return this._Service.SetSort(obj.Id, obj.Sort);
        }
        public SpecGroupTItem[] GetSpecGroupTItems (GetSpecGroupTItems obj)
        {
            return this._Service.GetItems(obj.CategoryId);
        }
        public long AddSpecGroupT (AddSpecGroupT add)
        {
            return this._Service.Add(add.Datum);
        }

        public void DeleteSpecGroupT (DeleteSpecGroupT obj)
        {
            this._Service.Delete(obj.Id);
        }

        public SpecGroupT GetSpecGroupT (GetSpecGroupT obj)
        {
            return this._Service.Get(obj.Id);
        }

        public SpecGroupTDto[] GetsSpecGroupT (GetsSpecGroupT query)
        {
            return this._Service.Gets(query.CategoryId);
        }

        public bool SetSpecGroupT (SetSpecGroupT set)
        {
            return this._Service.Set(set.Id, set.Datum);
        }

        public void SetSpecGroupTIsEnable (SetSpecGroupTIsEnable set)
        {
            this._Service.SetIsEnable(set.Id, set.IsEnable);
        }
    }
}
